


# to load data
library(rio)

# to process data
library(tidyverse)


#### GENERATE FIGURE 4
load("workspace_topic_models.Rdata")
results_binding %>%
  select(year,topic1_natres) %>%
  group_by(year) %>%
  summarise(mean = mean(topic1_natres)) %>%
  ggplot(aes(x=year, y=mean)) + geom_line() + theme_minimal() + 
  theme(axis.text.x = element_text(size=12), axis.text.y = element_text(size=12), 
        axis.title.x = element_text(size=12), axis.title.y = element_text(size=12)) + 
  xlab("Year") + ylab(expression("Mean of" ~ theta))

ggsave("figure4.pdf", height = 6, width=7)

